package day11;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest2 {
    public static void main(String[] args) {
        Class<ArrayList> c = ArrayList.class;
        //获得所有的属性，方法，构造方法
        Field[] fields = c.getDeclaredFields();
        for(Field f:fields){
            System.out.println(f);
        }
        System.out.println(">>>>>>>>>>方法>>>>>>>>>>>>>>>>");
        Method[] methods = c.getDeclaredMethods();
        for(Method m:methods)
        {
            System.out.println(m);
        }
        System.out.println(">>>>>>>>>>构造方法>>>>>>>>>>>>>>>>");
        Constructor<?>[] constructors = c.getDeclaredConstructors();
        for(Constructor cc:constructors){
            System.out.println(cc);
        }
    }
}
